import type { DynamicField } from "@/data/wbsFields.ts";

export const tableFields: DynamicField[] = [
  {
    id: 1,
    field: "id",
    type: "text",
    invisible: false,
    name: "id",
  },
  {
    id: 2,
    field: "name",
    uiType: "language",
    width: 250,
    invisible: true,
    name: "模板名称",
  },
  // {
  //   id: 6,
  //   field: "statusFlag",
  //   type: "switch",
  //   invisible: true,
  //   checkedText: "是",
  //   uncheckedText: "否",
  //   name: "是否启用",
  // },
  {
    id: 3,
    field: "creatorName",
    uiType: "user",
    invisible: true,
    name: "创建人",
  },
  {
    id: 6,
    field: "useCount",
    type: "text",
    uiType: "text",
    invisible: true,
    name: "引用项目（数量）",
  },
  {
    id: 7,
    field: "statusFlag",
    uiType: "switch",
    invisible: true,
    name: "是否启用",
  },
  {
    id: 4,
    field: "createTime",
    uiType: "date",
    invisible: true,
    name: "创建时间",
  },
  {
    id: 5,
    field: "remark",
    type: "text",
    invisible: true,
    name: "描述",
  },
];

export const dialogCreateOrEditFields: DynamicField[] = [
  {
    id: 1,
    field: "id",
    type: "text",
    invisible: false,
    name: "id",
  },
  {
    id: 2,
    field: "name",
    type: "text",
    invisible: true,
    name: "模板名称",
    rules: [{ required: true, message: "请输入模板名称", trigger: "blur" }],
  },
  {
    id: 3,
    field: "projectId",
    type: "select",
    // uiType: "select",
    invisible: true,
    name: "选择项目",
    rules: [{ required: true, message: "请选择项目", trigger: "blur" }],
    options: [],
  },
  {
    id: 4,
    field: "status",
    type: "switch",
    switchActiveValue: "NORMAL",
    switchInactiveValue: "DISABLED",
    // uiType: "select",
    invisible: true,
    defaultValue: "DISABLED",
    name: "是否启用",
    // rules: [{ required: true, message: "请选择项目", trigger: "blur" }],
    // options: [],
  },
  {
    id: 5,
    field: "remark",
    type: "textarea",
    invisible: true,
    name: "描述",
  },
];
